Skip to content

fix(security): replace method wildcards with explicit GET+POST in baseline policy#1034

Open
stikman28 wants to merge 1 commit intoNVIDIA:mainfrom
stikman28:fix/restrict-policy-method-wildcards
Open

fix(security): replace method wildcards with explicit GET+POST in baseline policy#1034
stikman28 wants to merge 1 commit intoNVIDIA:mainfrom
stikman28:fix/restrict-policy-method-wildcards

Conversation

@stikman28
Copy link
Copy Markdown

@stikman28 stikman28 commented Mar 27, 2026

Summary

Replace method: "*" with explicit GET and POST rules on all inference provider endpoints in the baseline sandbox policy. The wildcard permits DELETE, PUT, and PATCH methods that these APIs do not require, increasing the attack surface if an agent or plugin is compromised.

Changes

  • api.anthropic.com: method: "*"GET + POST
  • statsig.anthropic.com: method: "*"GET + POST
  • sentry.io: method: "*"GET + POST
  • integrate.api.nvidia.com: method: "*"GET + POST
  • inference-api.nvidia.com: method: "*"GET + POST

Inference calls use POST (completions, messages, token counting) and GET (model listing, health checks, usage). No other HTTP methods are required. No functional change.

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

  • Added test/security-method-wildcards.test.js — validates no method: "*" wildcards exist in baseline policy
  • npx prek run --all-files passes.
  • npm test passes.

Checklist

General

Code Changes

  • Formatters applied.
  • Tests added for new behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes. (N/A — no user-facing behavior change)

Summary by CodeRabbit

  • Security

    • Enhanced network access control policies to restrict specified services to explicit HTTP methods (GET and POST) instead of allowing all methods, reducing attack surface.
  • Tests

    • Added automated validation to ensure network policies comply with security standards by preventing overly permissive method configurations.

…eline policy

Replace `method: "*"` with explicit `GET` and `POST` rules on all
inference provider endpoints in the baseline sandbox policy:

- api.anthropic.com (Claude API)
- statsig.anthropic.com (telemetry)
- sentry.io (crash reporting)
- integrate.api.nvidia.com (NVIDIA inference)
- inference-api.nvidia.com (NVIDIA inference alt)

The wildcard permits DELETE, PUT, and PATCH methods that these APIs
do not require. Inference calls use POST (completions, messages,
token counting) and GET (model listing, health checks, usage).
Restricting to these two methods reduces the attack surface if an
agent or plugin is compromised — it cannot issue destructive HTTP
methods against the inference providers.

No functional change: all existing agent operations (inference,
telemetry, crash reporting) use only GET and POST.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f04600ae-c435-4de5-989a-d4c474b69b74

📥 Commits

Reviewing files that changed from the base of the PR and between 5f692e5 and 67d52f0.

📒 Files selected for processing (2)
  • nemoclaw-blueprint/policies/openclaw-sandbox.yaml
  • test/security-method-wildcards.test.js

📝 Walkthrough

Walkthrough

This PR updates a network sandbox policy YAML file to replace wildcard HTTP method allowances with explicit GET and POST methods for specified external API hosts, and adds a test to validate the policy contains no wildcard method rules.

Changes

Cohort / File(s) Summary
Network Policy Update
nemoclaw-blueprint/policies/openclaw-sandbox.yaml
Replaced method: "*" with explicit GET and POST allowances for claude_code and nvidia host rules accessing "/**" paths.
Security Validation Test
test/security-method-wildcards.test.js
Added new test that loads the sandbox policy YAML and asserts no method: "*" entries exist in the file using regex line-by-line scanning.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A rabbit hops through policies so clear,
No wildcards left for methods here!
With GET and POST, explicit and bright,
The sandbox walls now hold them tight! 🔒

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: replacing method wildcards with explicit HTTP methods in the baseline security policy.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant